#include "chatdialog.h"
#include "maindialog.h"
#include "ui_maindialog.h"

MainDialog::MainDialog(const QString& userName, QWidget *parent) :
    QDialog(parent), m_userName(userName),
    ui(new Ui::MainDialog)
{
    ui->setupUi(this);

    ui->labelWelcome->setText(m_userName + "您好！欢迎使用本系统！");
}

MainDialog::~MainDialog()
{
    delete ui;
}

void MainDialog::on_btnChat_clicked()
{
    ChatDialog* pdlg = new ChatDialog(this);

    pdlg->setAttribute(Qt::WA_DeleteOnClose);

    pdlg->show();

}
